home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0040_VGA BGI & Detect.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  1KB  |  62 lines

  1. (*
  2. ERIC MILLER
  3.  
  4. > Let's suppose that I used VGA256.BGI.  I change it to VGA256.OBJ.  And in
  5. > my program, I type the following: {$L VGA256.OBJ}
  6.  
  7. Well, you can't lin VGA256.BGI into the program that way; for some
  8. reason, if it wasn't included in TP6 it won't register.  You have
  9. to use the InstallUserDriver function instead of RegisterBGIDriver.
  10. Here is a program that get's into VGA256 mode that way - but of
  11. course you must already know how to do it.
  12. *)
  13.  
  14. PROGRAM Vg;
  15.  
  16. Uses
  17.   Graph;
  18.  
  19. FUNCTION vgaPresent : boolean; assembler;
  20. asm
  21.   mov ah,$F
  22.   int $10
  23.   mov ax,$1A00
  24.   int $10      {check for VGA/MCGA}
  25.   cmp al,$1A
  26.   jne @ERR     {no VGA Bios}
  27.   cmp bl,7
  28.   jb @ERR      {is VGA or better?}
  29.   cmp bl,$FF
  30.   jnz @OK
  31.  @ERR:
  32.   xor al,al
  33.   jmp @EXIT
  34.  @OK:
  35.   mov al,1
  36.  @EXIT:
  37. end;
  38.  
  39. {$F+}
  40. FUNCTION DetectVGA256: Integer;
  41. BEGIN
  42.   IF vgaPresent THEN
  43.     DetectVGA256 := 0
  44.   ELSE
  45.     DetectVGA256 := grError;
  46. END;
  47. {$F-}
  48.  
  49.  
  50. VAR
  51.   VGA256: Integer;
  52.   B: Integer;
  53.  
  54. BEGIN
  55.   VGA256 := InstallUserDriver('VGA256', @DetectVGA256);
  56.   B := 0;
  57.   InitGraph(VGA256, B, '');
  58.   OutText('In 320x200x256 - press enter');
  59.   Readln;
  60.   CloseGraph;
  61. END.
  62.